home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle 2004 #2 / K-CD-2-2004.ISO / OpenOffice Sv / f_0397 / python-core-2.2.2 / lib / test / test_capi.py < prev    next >
Encoding:
Python Source  |  2003-07-18  |  493 b   |  17 lines

  1. # Run the _testcapi module tests (tests for the Python/C API):  by defn,
  2. # these are all functions _testcapi exports whose name begins with 'test_'.
  3.  
  4. import sys
  5. import test_support
  6. import _testcapi
  7.  
  8. for name in dir(_testcapi):
  9.     if name.startswith('test_'):
  10.         test = getattr(_testcapi, name)
  11.         if test_support.verbose:
  12.             print "internal", name
  13.         try:
  14.             test()
  15.         except _testcapi.error:
  16.             raise test_support.TestFailed, sys.exc_info()[1]
  17.